package com.mx.kn.cstf2.service.impl;

import java.sql.SQLException;
import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import kn.cstf2.transition.Bean.TransitionBean;

import com.mx.kn.cstf2.dao.ImplementationDao;
import com.mx.kn.cstf2.dao.TransitionDao;
import com.mx.kn.cstf2.dto.LinksDto;
import com.mx.kn.cstf2.service.ImplementationService;

@Service
public class ImplementationServiceImpl implements ImplementationService{

	@Autowired ImplementationDao implementationDao;
	@Autowired TransitionDao transitionDao;
	
	@Override
	public List<LinksDto> getLinksTransition(TransitionBean transition)
			throws SQLException {
		return implementationDao.getLinksTransition(transition);
	}

	@Override
	public List<LinksDto> insertLink(TransitionBean transition, String link,
			String description, String displayName) throws SQLException {
		
		return implementationDao.insertLink(transition, link, description, displayName);
	}

	@Override
	public TransitionBean updateStatusDocumentsCop(boolean status, String date,
			String fechas, TransitionBean transition) throws SQLException {
		implementationDao.updateStatusDocumentsCop(status, date, fechas, transition);
		return transitionDao.obtenerTransitionBeanByKnkeyAndId(transition);
		
	}

	@Override
	public TransitionBean updateStatusDocumentsContacts(boolean status,
			String date, String fecha, TransitionBean transition)
			throws SQLException {
		implementationDao.updateStatusDocumentsContacts(status, date, fecha, transition);
		return transitionDao.obtenerTransitionBeanByKnkeyAndId(transition);
	}

	@Override
	public TransitionBean updateStatusDocumentsReporting(boolean status,
			String date, String fecha, TransitionBean transition)
			throws SQLException {
		implementationDao.updateStatusDocumentsReporting(status, date, fecha, transition);
		return transitionDao.obtenerTransitionBeanByKnkeyAndId(transition);
	}

	@Override
	public TransitionBean updateStatusDocumentsSos(boolean status, String date,
			String fecha, TransitionBean transition) throws SQLException {
		implementationDao.updateStatusDocumentsSos(status, date, fecha, transition);
		return transitionDao.obtenerTransitionBeanByKnkeyAndId(transition);
	}

	@Override
	public TransitionBean updateStatusDocumentsConditions(boolean status,
			String date, String fecha, TransitionBean transition)
			throws SQLException {
		implementationDao.updateStatusDocumentsConditions(status, date, fecha, transition);
		return transitionDao.obtenerTransitionBeanByKnkeyAndId(transition);
	}

	@Override
	public TransitionBean updateStatusDocumentsCielID(boolean status,
			String date, String fecha, TransitionBean transition)
			throws SQLException {
		implementationDao.updateStatusDocumentsCielID(status, date, fecha, transition);
		return transitionDao.obtenerTransitionBeanByKnkeyAndId(transition);
	}

	@Override
	public TransitionBean updateStatusDocumentsCielQ(boolean status, String date,
			String fecha, TransitionBean transition) throws SQLException {
		implementationDao.updateStatusDocumentsCielQ(status, date, fecha, transition);
		return transitionDao.obtenerTransitionBeanByKnkeyAndId(transition);
	}

	@Override
	public TransitionBean updateStatusDocumentsCarrier(boolean status,
			String date, String fecha, TransitionBean transition)
			throws SQLException {
		implementationDao.updateStatusDocumentsCarrier(status, date, fecha, transition);
		return transitionDao.obtenerTransitionBeanByKnkeyAndId(transition);
	}

	@Override
	public TransitionBean updateStatusDocumentsWorking(boolean status,
			String date, String fecha, TransitionBean transition)
			throws SQLException {
		implementationDao.updateStatusDocumentsWorking(status, date, fecha, transition);
		return transitionDao.obtenerTransitionBeanByKnkeyAndId(transition);
	}

	@Override
	public TransitionBean updateStatusDocumentsSop(boolean status, String date,
			String fecha, TransitionBean transition) throws SQLException {
		implementationDao.updateStatusDocumentsSop(status, date, fecha, transition);
		return transitionDao.obtenerTransitionBeanByKnkeyAndId(transition);
	}

	@Override
	public TransitionBean updateStatusDocumentsKpi(boolean status, String date,
			String fecha, TransitionBean transition) throws SQLException {
		implementationDao.updateStatusDocumentsKpi(status, date, fecha, transition);
		return transitionDao.obtenerTransitionBeanByKnkeyAndId(transition);
	}

	@Override
	public TransitionBean updateStatusDocumentsBilling(boolean status,
			String date, String fecha, TransitionBean transition)
			throws SQLException {
		implementationDao.updateStatusDocumentsBilling(status, date, fecha, transition);
		return transitionDao.obtenerTransitionBeanByKnkeyAndId(transition);
	}
	
	
	
	
}
